FROM fnndsc/ubuntu-python3

COPY . /app
WORKDIR /app
RUN apt update && apt install -y libmysqlclient-dev mysql-client
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
RUN pip install -r requirements.txt

RUN chmod +x script/createsuperuser \
	&& chmod +x script/docker-entrypoint.sh \
	&& cp script/createsuperuser /usr/bin/createsuperuser

EXPOSE 8000
ENTRYPOINT [ "/app/script/docker-entrypoint.sh" ]
